# -*- coding: utf-8 -*-
"""
@Time : 2023/6/11 18:22
@Author : ChenXiaoliang
@Email : middlegod@sina.com
@File : mysql_connect.py
"""

import pymysql
import sys


class MySQLConnected():
    def __init__(self, dbinfo):
        try:
            self.con = pymysql.connect(**dbinfo)
            self.cur = self.con.cursor()
        except Exception as e:
            print(f"failed:{e}")
            sys.exit(f"数据库连接失败\n{e}")
